package com.hzjh.h5mall.ui.test

import com.alibaba.android.arouter.facade.annotation.Route
import com.hzjh.base.ext.frame.JHBaseActivity
import com.hzjh.base.ext.route.RouteUrl
import com.hzjh.base.utils.other.CommUtils
import com.hzjh.h5mall.BuildConfig
import com.hzjh.h5mall.R
import com.hzjh.h5mall.databinding.ActivityTestBinding
import com.hzjh.h5mall.model.test.TestModel
import com.hzjh.service.metamask.MetaMaskUtils

@Route(path = RouteUrl.TEST_ACTIVITY)
class TestActivity : JHBaseActivity<ActivityTestBinding,TestModel>() {
    override fun initData() {
        MetaMaskUtils.init(CommUtils.getString(R.string.app_name), BuildConfig.h5Url)
    }

    override fun initView() {
        viewBinding.btnConnect.setOnClickListener {
            MetaMaskUtils.getInstance()?.reqConnect()
        }
        viewBinding.btnBalance.setOnClickListener {
            MetaMaskUtils.getInstance()?.reqGetBalance()
        }
        viewBinding.btnTransaction.setOnClickListener {
//            MetaMaskUtils.getInstance()?.reqSendTransaction("0x0000000000000000000000000000000000000000","0.01")
        }
    }

    override fun initViewBinding(): ActivityTestBinding {
        return ActivityTestBinding.inflate(layoutInflater)
    }

}